<?php
/*
 * @Author: your name
 * @Date: 2020-10-26 13:34:54
 * @LastEditTime: 2020-12-17 11:22:59
 * @LastEditors: Please set LastEditors
 * @Description: 系统伪装主机
 * @FilePath: /special/application/adminapiv3/validate/DisguiseHostValidate.php
 */
namespace app\adminapiv3\validate;

use think\Validate;

class DisguiseHostValidate extends Validate
{
    protected $rule = [
        //资产名
        'name|资产名称' => 'length:1,50',
        //资产ip
        'ip|资产IP地址' => 'regex:^\d{1,3}(\.\d{1,3}){0,3}$',
        //主机系统类别 1windows 2Linux
        'os|主机系统类型' => 'in:0,1,2',
        //伪装端口
        'guise_port|伪装端口' => 'number|between:1,65535',
        //是否在线
        'online|主机在线信息' => 'in:0,1'
    ];

    //错误消息
    protected $message = [
        'os.in' => '主机系统类型格式错误',
        'online.in' => '主机在线信息格式错误',
    ];

    protected $scene = [
        'listFilter' => ['name','ip','os','guise_port','online'],
    ];
}